package com.work.flow;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import java.io.File;

@Component
@Order(1)
public class Runner implements ApplicationRunner {
    @Value("${oss.path}")
    String path;
    @Override
    public void run(ApplicationArguments args) throws Exception {
        //创建OSS文件夹
        File file = new File(path);
        if (!(file.exists()&&file.isDirectory())) {
            file.mkdirs();
            System.out.println("创建OSS文件夹"+path);
        }else {
            System.out.println("OSS文件夹已存在");
        }
    }
}
